const fs = require('fs')

const fileArr = fs.readdirSync(__dirname)
const db = {}

for (let fileName of fileArr) {
	fileName = fileName.replace(/\.js/, '')
	if (fileName.indexOf('collection-') < 0)
		continue
	let collection = fileName.replace('collection-', '')
	db[`${collection}ColPromise`] = require(`./${fileName}`)
}

module.exports = db